3.1.17 \(\int x (a+b \tanh ^{-1}(c x))^2 \, dx\) [17]

Optimal. Leaf size=75 \[ \frac {a b x}{c}+\frac {b^2 x \tanh ^{-1}(c x)}{c}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c^2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2+\frac {b^2 \log \left (1-c^2 x^2\right )}{2 c^2} \]

[Out]

a*b*x/c+b^2*x*arctanh(c*x)/c-1/2*(a+b*arctanh(c*x))^2/c^2+1/2*x^2*(a+b*arctanh(c*x))^2+1/2*b^2*ln(-c^2*x^2+1)/
c^2

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {6037, 6127, 6021, 266, 6095} \begin {gather*} -\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c^2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2+\frac {a b x}{c}+\frac {b^2 \log \left (1-c^2 x^2\right )}{2 c^2}+\frac {b^2 x \tanh ^{-1}(c x)}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*(a + b*ArcTanh[c*x])^2,x]

[Out]

(a*b*x)/c + (b^2*x*ArcTanh[c*x])/c - (a + b*ArcTanh[c*x])^2/(2*c^2) + (x^2*(a + b*ArcTanh[c*x])^2)/2 + (b^2*Lo
g[1 - c^2*x^2])/(2*c^2)

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 6021

Int[((a_.) + ArcTanh[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTanh[c*x^n])^p, x] - Dist[b
*c*n*p, Int[x^n*((a + b*ArcTanh[c*x^n])^(p - 1)/(1 - c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p
, 0] && (EqQ[n, 1] || EqQ[p, 1])

Rule 6037

Int[((a_.) + ArcTanh[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTanh[c*
x^n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTanh[c*x^n])^(p - 1)/(1 - c^2*x^(2*n))
), x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1
]

Rule 6095

Int[((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTanh[c*x])^(p
 + 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[c^2*d + e, 0] && NeQ[p, -1]

Rule 6127

Int[(((a_.) + ArcTanh[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2
/e, Int[(f*x)^(m - 2)*(a + b*ArcTanh[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTanh[c*x])
^p/(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rubi steps

\begin {align*} \int x \left (a+b \tanh ^{-1}(c x)\right )^2 \, dx &=\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2-(b c) \int \frac {x^2 \left (a+b \tanh ^{-1}(c x)\right )}{1-c^2 x^2} \, dx\\ &=\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2+\frac {b \int \left (a+b \tanh ^{-1}(c x)\right ) \, dx}{c}-\frac {b \int \frac {a+b \tanh ^{-1}(c x)}{1-c^2 x^2} \, dx}{c}\\ &=\frac {a b x}{c}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c^2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2+\frac {b^2 \int \tanh ^{-1}(c x) \, dx}{c}\\ &=\frac {a b x}{c}+\frac {b^2 x \tanh ^{-1}(c x)}{c}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c^2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2-b^2 \int \frac {x}{1-c^2 x^2} \, dx\\ &=\frac {a b x}{c}+\frac {b^2 x \tanh ^{-1}(c x)}{c}-\frac {\left (a+b \tanh ^{-1}(c x)\right )^2}{2 c^2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}(c x)\right )^2+\frac {b^2 \log \left (1-c^2 x^2\right )}{2 c^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 90, normalized size = 1.20 \begin {gather*} \frac {2 a b c x+a^2 c^2 x^2+2 b c x (b+a c x) \tanh ^{-1}(c x)+b^2 \left (-1+c^2 x^2\right ) \tanh ^{-1}(c x)^2+b (a+b) \log (1-c x)-a b \log (1+c x)+b^2 \log (1+c x)}{2 c^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*ArcTanh[c*x])^2,x]

[Out]

(2*a*b*c*x + a^2*c^2*x^2 + 2*b*c*x*(b + a*c*x)*ArcTanh[c*x] + b^2*(-1 + c^2*x^2)*ArcTanh[c*x]^2 + b*(a + b)*Lo
g[1 - c*x] - a*b*Log[1 + c*x] + b^2*Log[1 + c*x])/(2*c^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(214\) vs. \(2(69)=138\).
time = 0.03, size = 215, normalized size = 2.87

method result size
risch \(\frac {b^{2} \left (c^{2} x^{2}-1\right ) \ln \left (c x +1\right )^{2}}{8 c^{2}}+\frac {b \left (-b \,x^{2} \ln \left (-c x +1\right ) c^{2}+2 a \,c^{2} x^{2}+2 b c x +b \ln \left (-c x +1\right )\right ) \ln \left (c x +1\right )}{4 c^{2}}+\frac {\ln \left (-c x +1\right )^{2} b^{2} x^{2}}{8}-\frac {\ln \left (-c x +1\right ) a b \,x^{2}}{2}+\frac {a^{2} x^{2}}{2}-\frac {b^{2} x \ln \left (-c x +1\right )}{2 c}-\frac {b^{2} \ln \left (-c x +1\right )^{2}}{8 c^{2}}+\frac {a b x}{c}+\frac {b \ln \left (-c x +1\right ) a}{2 c^{2}}+\frac {b^{2} \ln \left (-c x +1\right )}{2 c^{2}}-\frac {b \ln \left (c x +1\right ) a}{2 c^{2}}+\frac {b^{2} \ln \left (c x +1\right )}{2 c^{2}}\) \(214\)
derivativedivides \(\frac {\frac {c^{2} x^{2} a^{2}}{2}+\frac {b^{2} c^{2} x^{2} \arctanh \left (c x \right )^{2}}{2}+b^{2} \arctanh \left (c x \right ) c x +\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x -1\right )}{2}-\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x +1\right )}{2}-\frac {b^{2} \ln \left (c x -1\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4}+\frac {b^{2} \ln \left (c x -1\right )^{2}}{8}+\frac {b^{2} \ln \left (c x -1\right )}{2}+\frac {b^{2} \ln \left (c x +1\right )}{2}+\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4}-\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (c x +1\right )}{4}+\frac {b^{2} \ln \left (c x +1\right )^{2}}{8}+a b \,c^{2} x^{2} \arctanh \left (c x \right )+a b c x +\frac {a b \ln \left (c x -1\right )}{2}-\frac {a b \ln \left (c x +1\right )}{2}}{c^{2}}\) \(215\)
default \(\frac {\frac {c^{2} x^{2} a^{2}}{2}+\frac {b^{2} c^{2} x^{2} \arctanh \left (c x \right )^{2}}{2}+b^{2} \arctanh \left (c x \right ) c x +\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x -1\right )}{2}-\frac {b^{2} \arctanh \left (c x \right ) \ln \left (c x +1\right )}{2}-\frac {b^{2} \ln \left (c x -1\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4}+\frac {b^{2} \ln \left (c x -1\right )^{2}}{8}+\frac {b^{2} \ln \left (c x -1\right )}{2}+\frac {b^{2} \ln \left (c x +1\right )}{2}+\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (\frac {c x}{2}+\frac {1}{2}\right )}{4}-\frac {b^{2} \ln \left (-\frac {c x}{2}+\frac {1}{2}\right ) \ln \left (c x +1\right )}{4}+\frac {b^{2} \ln \left (c x +1\right )^{2}}{8}+a b \,c^{2} x^{2} \arctanh \left (c x \right )+a b c x +\frac {a b \ln \left (c x -1\right )}{2}-\frac {a b \ln \left (c x +1\right )}{2}}{c^{2}}\) \(215\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*arctanh(c*x))^2,x,method=_RETURNVERBOSE)

[Out]

1/c^2*(1/2*c^2*x^2*a^2+1/2*b^2*c^2*x^2*arctanh(c*x)^2+b^2*arctanh(c*x)*c*x+1/2*b^2*arctanh(c*x)*ln(c*x-1)-1/2*
b^2*arctanh(c*x)*ln(c*x+1)-1/4*b^2*ln(c*x-1)*ln(1/2*c*x+1/2)+1/8*b^2*ln(c*x-1)^2+1/2*b^2*ln(c*x-1)+1/2*b^2*ln(
c*x+1)+1/4*b^2*ln(-1/2*c*x+1/2)*ln(1/2*c*x+1/2)-1/4*b^2*ln(-1/2*c*x+1/2)*ln(c*x+1)+1/8*b^2*ln(c*x+1)^2+a*b*c^2
*x^2*arctanh(c*x)+a*b*c*x+1/2*a*b*ln(c*x-1)-1/2*a*b*ln(c*x+1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 158 vs. \(2 (69) = 138\).
time = 0.28, size = 158, normalized size = 2.11 \begin {gather*} \frac {1}{2} \, b^{2} x^{2} \operatorname {artanh}\left (c x\right )^{2} + \frac {1}{2} \, a^{2} x^{2} + \frac {1}{2} \, {\left (2 \, x^{2} \operatorname {artanh}\left (c x\right ) + c {\left (\frac {2 \, x}{c^{2}} - \frac {\log \left (c x + 1\right )}{c^{3}} + \frac {\log \left (c x - 1\right )}{c^{3}}\right )}\right )} a b + \frac {1}{8} \, {\left (4 \, c {\left (\frac {2 \, x}{c^{2}} - \frac {\log \left (c x + 1\right )}{c^{3}} + \frac {\log \left (c x - 1\right )}{c^{3}}\right )} \operatorname {artanh}\left (c x\right ) - \frac {2 \, {\left (\log \left (c x - 1\right ) - 2\right )} \log \left (c x + 1\right ) - \log \left (c x + 1\right )^{2} - \log \left (c x - 1\right )^{2} - 4 \, \log \left (c x - 1\right )}{c^{2}}\right )} b^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*arctanh(c*x))^2,x, algorithm="maxima")

[Out]

1/2*b^2*x^2*arctanh(c*x)^2 + 1/2*a^2*x^2 + 1/2*(2*x^2*arctanh(c*x) + c*(2*x/c^2 - log(c*x + 1)/c^3 + log(c*x -
 1)/c^3))*a*b + 1/8*(4*c*(2*x/c^2 - log(c*x + 1)/c^3 + log(c*x - 1)/c^3)*arctanh(c*x) - (2*(log(c*x - 1) - 2)*
log(c*x + 1) - log(c*x + 1)^2 - log(c*x - 1)^2 - 4*log(c*x - 1))/c^2)*b^2

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 122, normalized size = 1.63 \begin {gather*} \frac {4 \, a^{2} c^{2} x^{2} + 8 \, a b c x + {\left (b^{2} c^{2} x^{2} - b^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )^{2} - 4 \, {\left (a b - b^{2}\right )} \log \left (c x + 1\right ) + 4 \, {\left (a b + b^{2}\right )} \log \left (c x - 1\right ) + 4 \, {\left (a b c^{2} x^{2} + b^{2} c x\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{8 \, c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*arctanh(c*x))^2,x, algorithm="fricas")

[Out]

1/8*(4*a^2*c^2*x^2 + 8*a*b*c*x + (b^2*c^2*x^2 - b^2)*log(-(c*x + 1)/(c*x - 1))^2 - 4*(a*b - b^2)*log(c*x + 1)
+ 4*(a*b + b^2)*log(c*x - 1) + 4*(a*b*c^2*x^2 + b^2*c*x)*log(-(c*x + 1)/(c*x - 1)))/c^2

________________________________________________________________________________________

Sympy [A]
time = 0.24, size = 114, normalized size = 1.52 \begin {gather*} \begin {cases} \frac {a^{2} x^{2}}{2} + a b x^{2} \operatorname {atanh}{\left (c x \right )} + \frac {a b x}{c} - \frac {a b \operatorname {atanh}{\left (c x \right )}}{c^{2}} + \frac {b^{2} x^{2} \operatorname {atanh}^{2}{\left (c x \right )}}{2} + \frac {b^{2} x \operatorname {atanh}{\left (c x \right )}}{c} + \frac {b^{2} \log {\left (x - \frac {1}{c} \right )}}{c^{2}} - \frac {b^{2} \operatorname {atanh}^{2}{\left (c x \right )}}{2 c^{2}} + \frac {b^{2} \operatorname {atanh}{\left (c x \right )}}{c^{2}} & \text {for}\: c \neq 0 \\\frac {a^{2} x^{2}}{2} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*atanh(c*x))**2,x)

[Out]

Piecewise((a**2*x**2/2 + a*b*x**2*atanh(c*x) + a*b*x/c - a*b*atanh(c*x)/c**2 + b**2*x**2*atanh(c*x)**2/2 + b**
2*x*atanh(c*x)/c + b**2*log(x - 1/c)/c**2 - b**2*atanh(c*x)**2/(2*c**2) + b**2*atanh(c*x)/c**2, Ne(c, 0)), (a*
*2*x**2/2, True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 301 vs. \(2 (69) = 138\).
time = 0.40, size = 301, normalized size = 4.01 \begin {gather*} \frac {1}{2} \, {\left (\frac {{\left (c x + 1\right )} b^{2} \log \left (-\frac {c x + 1}{c x - 1}\right )^{2}}{{\left (\frac {{\left (c x + 1\right )}^{2} c^{3}}{{\left (c x - 1\right )}^{2}} - \frac {2 \, {\left (c x + 1\right )} c^{3}}{c x - 1} + c^{3}\right )} {\left (c x - 1\right )}} + \frac {2 \, {\left (\frac {2 \, {\left (c x + 1\right )} a b}{c x - 1} + \frac {{\left (c x + 1\right )} b^{2}}{c x - 1} - b^{2}\right )} \log \left (-\frac {c x + 1}{c x - 1}\right )}{\frac {{\left (c x + 1\right )}^{2} c^{3}}{{\left (c x - 1\right )}^{2}} - \frac {2 \, {\left (c x + 1\right )} c^{3}}{c x - 1} + c^{3}} + \frac {4 \, {\left (\frac {{\left (c x + 1\right )} a^{2}}{c x - 1} + \frac {{\left (c x + 1\right )} a b}{c x - 1} - a b\right )}}{\frac {{\left (c x + 1\right )}^{2} c^{3}}{{\left (c x - 1\right )}^{2}} - \frac {2 \, {\left (c x + 1\right )} c^{3}}{c x - 1} + c^{3}} - \frac {2 \, b^{2} \log \left (-\frac {c x + 1}{c x - 1} + 1\right )}{c^{3}} + \frac {2 \, b^{2} \log \left (-\frac {c x + 1}{c x - 1}\right )}{c^{3}}\right )} c \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*arctanh(c*x))^2,x, algorithm="giac")

[Out]

1/2*((c*x + 1)*b^2*log(-(c*x + 1)/(c*x - 1))^2/(((c*x + 1)^2*c^3/(c*x - 1)^2 - 2*(c*x + 1)*c^3/(c*x - 1) + c^3
)*(c*x - 1)) + 2*(2*(c*x + 1)*a*b/(c*x - 1) + (c*x + 1)*b^2/(c*x - 1) - b^2)*log(-(c*x + 1)/(c*x - 1))/((c*x +
 1)^2*c^3/(c*x - 1)^2 - 2*(c*x + 1)*c^3/(c*x - 1) + c^3) + 4*((c*x + 1)*a^2/(c*x - 1) + (c*x + 1)*a*b/(c*x - 1
) - a*b)/((c*x + 1)^2*c^3/(c*x - 1)^2 - 2*(c*x + 1)*c^3/(c*x - 1) + c^3) - 2*b^2*log(-(c*x + 1)/(c*x - 1) + 1)
/c^3 + 2*b^2*log(-(c*x + 1)/(c*x - 1))/c^3)*c

________________________________________________________________________________________

Mupad [B]
time = 0.78, size = 89, normalized size = 1.19 \begin {gather*} \frac {a^2\,x^2}{2}-\frac {\frac {b^2\,{\mathrm {atanh}\left (c\,x\right )}^2}{2}-\frac {b^2\,\ln \left (c^2\,x^2-1\right )}{2}-c\,\left (x\,\mathrm {atanh}\left (c\,x\right )\,b^2+a\,x\,b\right )+a\,b\,\mathrm {atanh}\left (c\,x\right )}{c^2}+\frac {b^2\,x^2\,{\mathrm {atanh}\left (c\,x\right )}^2}{2}+a\,b\,x^2\,\mathrm {atanh}\left (c\,x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b*atanh(c*x))^2,x)

[Out]

(a^2*x^2)/2 - ((b^2*atanh(c*x)^2)/2 - (b^2*log(c^2*x^2 - 1))/2 - c*(b^2*x*atanh(c*x) + a*b*x) + a*b*atanh(c*x)
)/c^2 + (b^2*x^2*atanh(c*x)^2)/2 + a*b*x^2*atanh(c*x)

________________________________________________________________________________________